<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 4.判断星期
        var week = +prompt('请输入日期:');
        if (week % 7 == 1) {
            alert('星期一');
        } else if (week % 7 == 2) {
            alert('星期二');
        } else if (week % 7 == 3) {
            alert('星期三');
        } else if (week % 7 == 4) {
            alert('星期四');
        } else if (week % 7 == 5) {
            alert('星期五');
        } else if (week % 7 == 6) {
            alert('星期六');
        } else if (week % 7 == 0) {
            alert('星期七');
        }

    </script>
</head>

<body>

</body>

</html>